package com.azt.api.dto;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.azt.utils.FormatUtil;

public class WeixinInfo {
	private String nick;
	private String avatar;
	private String unionid;
	private String accesstoken;
	private String refreshtoken;
	private String openid;
	private String appid;

	public String getNick() {
		String[] tokens = StringUtils.split(nick, ",");
		if (tokens!=null && tokens.length>0) {
			char[] charArray = new char[tokens.length];
			int i = 0;
			for (String token : tokens) {
				int ch = FormatUtil.parseInteger(token).intValue();
				charArray[i] = (char) ch;
				i++;
			}
			return String.valueOf(charArray);
		}else{
			return null;
		}

	}

	public void setNick(String nick) {
		this.nick = nick;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getUnionid() {
		return unionid;
	}

	public void setUnionid(String unionid) {
		this.unionid = unionid;
	}

	public String getAccesstoken() {
		return accesstoken;
	}

	public void setAccesstoken(String accesstoken) {
		this.accesstoken = accesstoken;
	}

	public String getRefreshtoken() {
		return refreshtoken;
	}

	public void setRefreshtoken(String refreshtoken) {
		this.refreshtoken = refreshtoken;
	}

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

}
